<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>专家讲座</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" type="text/css" href="../../css/app.css" />
		<link rel="stylesheet" type="text/css" href="../../css/util/utils.css" />
	</head>
	<body style="background-color: white;">
		<div class="mui-content" style="background-color: white;">
			<div id="rfc-expLecLst" class="mui-scroll-wrapper" style="width: 100%; margin-top: -40px; background-color: white;">
				<div id="dv-lst-video" class="mui-scroll" style="width: 100%; display: block; margin-top: 0px; background-color: white;">
				</div>
			</div>
		</div>
	</body>
	<script src="../../js/mui.min.js"></script>
	<script src="../../js/utils/http.utils.js"></script>
	<script>
		var $wxfwid = localStorage.getItem("wxfwid");
		var $pCurr = 0;
		mui.init({
			pullRefresh: {
				container: "#rfc-expLecLst",
				up: {
					height: 2,
					auto: true,
					contentnomore: "加载中...",
					callback: fun_loadUpEepLecLst
				}
			}
		});

		function fun_loadUpEepLecLst() {
			fun_loadZJVideoLst($pageSize, $pCurr);
			mui("#rfc-expLecLst").pullRefresh().endPullupToRefresh(false); // 加载数据最没有更多内容
		}
		
		function fun_loadZJVideoLst($pSize, $cpage) {
			//获取视频列表
			mui.ajax({
				url: $request_url.getVideoLst,
				dataType: "json",
				type: "get",
				headers: {
					"Authorization": $headers_authorization
				},
				data: {
					typeCode: "ZJJZ",
					recommend : "",
					orgId: $wxfwid,
					rows: 3,
					page: $cpage
				},
				success: function(dat) {
					if(dat.code == 0) {
						var $videoLst = dat.result;
						if($videoLst != null && $videoLst.length > 0) {
							var $vlstDoc = document.getElementById("dv-lst-video");
							for(var i = 0; i < $videoLst.length; i++) {
								var $vlstDv = document.createElement('div');
								$vlstDv.innerHTML = fun_zjjzLstTem($videoLst[i], i);
								$vlstDoc.appendChild($vlstDv);
							}
							$pCurr++;
						} else {
							mui.toast("无数据来源");
						}
					}
				},
				error: function(err) {
					mui.toast("服务器繁忙....");
				}
			});
		}

		//视频列表模板
		function fun_zjjzLstTem(vidInfo, num) {
			var $vidInfoHtml =
				'<div style="margin: 5px 5px 10px 5px;">'
	            +	'<a style="color: black;" href="jzkt-videoDetailed.html?vid=' + vidInfo.id + '"><span style="color:#303030; font-size:16px">' + vidInfo.title + '</span>'
	            +	'<div style="margin-top: 5px;">'
	            +		'<img src="' + vidInfo.thumbnail + '" alt="无此图片" style="width: 100%; height: 220px;" />'
	            +	'</div></a>'
	            +	'<div style="margin-top: 5px;">'
	            +		'<span style="float: left; color:#909090; font-size:15px;">作者:' + vidInfo.origin + '</span>'
	            +		'<span style="float: right; color:#909090; font-size:15px; margin-right:10px;"><img src="../../img/jzkt/yanjing_03.png" width="16"/>&nbsp;' + vidInfo.readCount + '</span>'
	            +	'</div>'
	            +'</div><hr style="height: 1px; background-color: #DCDCDC; width: 100%; border: 0px; margin-top: 10px;">';
			return $vidInfoHtml;
		}
		
		mui('#dv-lst-video').on("tap", "a", function(){
			mui.openWindow({
				url : this.href
			});
		});
	</script>
</html>
